import {axioslink} from "api/api.js"

export let seach={
    state: {
        seach:[],
        zuijin:[],
        huati:[]
    },
    mutations: {
        SeachInit(state,payload){
            state[payload.key]=payload.value;
            // console.log(state.huati)
        }
    },
    actions: {
        //使用Actions 进行异步操作（异步请求)
        Seachxaxios(context){
            axioslink("/seach/list","get").then((ok)=>{
                context.commit("SeachInit",{key:"seach",value:ok.data.seach})
                context.commit("SeachInit",{key:"zuijin",value:ok.data.pindao.zuijin})
                context.commit("SeachInit",{key:"huati",value:ok.data.pindao.huati})
            })
        }
    }
}